Optimal. Leaf size=42 \[ (a B-b C) x-\frac {(b B+a C) \log (\cos (c+d x))}{d}+\frac {b C \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3713, 3606,
3556} \begin {gather*} -\frac {(a C+b B) \log (\cos (c+d x))}{d}+x (a B-b C)+\frac {b C \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3606
Rule 3713
Rubi steps
\begin {align*} \int \cot (c+d x) (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx &=\int (a+b \tan (c+d x)) (B+C \tan (c+d x)) \, dx\\ &=(a B-b C) x+\frac {b C \tan (c+d x)}{d}+(b B+a C) \int \tan (c+d x) \, dx\\ &=(a B-b C) x-\frac {(b B+a C) \log (\cos (c+d x))}{d}+\frac {b C \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 59, normalized size = 1.40 \begin {gather*} a B x-\frac {b C \text {ArcTan}(\tan (c+d x))}{d}-\frac {b B \log (\cos (c+d x))}{d}-\frac {a C \log (\cos (c+d x))}{d}+\frac {b C \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 53, normalized size = 1.26
method | result | size |
norman | \(\left (a B -C b \right ) x +\frac {b C \tan \left (d x +c \right )}{d}+\frac {\left (B b +C a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(47\) |
derivativedivides | \(\frac {-B b \ln \left (\cos \left (d x +c \right )\right )+C b \left (\tan \left (d x +c \right )-d x -c \right )+a B \left (d x +c \right )-C a \ln \left (\cos \left (d x +c \right )\right )}{d}\) | \(53\) |
default | \(\frac {-B b \ln \left (\cos \left (d x +c \right )\right )+C b \left (\tan \left (d x +c \right )-d x -c \right )+a B \left (d x +c \right )-C a \ln \left (\cos \left (d x +c \right )\right )}{d}\) | \(53\) |
risch | \(i B b x +i C a x +B a x -C b x +\frac {2 i B b c}{d}+\frac {2 i C a c}{d}+\frac {2 i C b}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B b}{d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) C a}{d}\) | \(100\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 50, normalized size = 1.19 \begin {gather*} \frac {2 \, C b \tan \left (d x + c\right ) + 2 \, {\left (B a - C b\right )} {\left (d x + c\right )} + {\left (C a + B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.46, size = 50, normalized size = 1.19 \begin {gather*} \frac {2 \, {\left (B a - C b\right )} d x + 2 \, C b \tan \left (d x + c\right ) - {\left (C a + B b\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 82 vs.
\(2 (36) = 72\).
time = 0.35, size = 82, normalized size = 1.95 \begin {gather*} \begin {cases} B a x + \frac {B b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {C a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - C b x + \frac {C b \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right ) \left (B \tan {\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) \cot {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.80, size = 50, normalized size = 1.19 \begin {gather*} \frac {2 \, C b \tan \left (d x + c\right ) + 2 \, {\left (B a - C b\right )} {\left (d x + c\right )} + {\left (C a + B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.79, size = 58, normalized size = 1.38 \begin {gather*} B\,a\,x-C\,b\,x+\frac {C\,b\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {B\,b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2\,d}+\frac {C\,a\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________